home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS19.ADF / C / Emacs_Keys.C < prev    next >
C/C++ Source or Header  |  1989-01-27  |  2KB  |  62 lines

  1.  
  2. /*  File: EMACS_KEYS.C ===================================
  3.  
  4.     Greg Douglas   2 Jan 87
  5.  
  6. Description: This program will create a file that
  7.   MicroEMACS can read to redefine keyboard functions. 
  8.   Use the EXTRAS menu LOAD KEY function to load the key 
  9.   definitions file.
  10.  
  11.   Compiled using Lattice 3.10 and linked using Blink
  12. ========================================================*/
  13.  
  14. #include <stdio.h>
  15. #define  NUMKEYS 24       /* Number of key definitions  */
  16.  
  17. void main()
  18.  /* string array can be up to 80 characters - I used 15 */
  19.  static char func_key[][15] =
  20.                            /*--- key definitions-------*/
  21.    { "~\n",                /* Auto start string        */
  22.      "\01\13\31\15\31~\n", /* F1 = ^A^K^Y^M^Y Dup line */
  23.      "\30\04~\n",          /* F2 = ^X^D    Delete line */
  24.      "\33-~\n",            /* F3 = ESC-    Set Mark    */
  25.      "\27~\n",             /* F4 = ^W      Kill region */
  26.      "\33W~\n",            /* F5 = ESC W   Copy region */
  27.      "\31~\n",             /* F6 = ^Y      Yank buffer */
  28.      "\33V~\n",            /* F7 = ESC V   Screen up   */
  29.      "\26~\n",             /* F8 = ^V      Screen down */
  30.      "\30\23~\n",          /* F9 = ^X^S    Save file   */
  31.      "\30\06~\n",          /* F10= ^X^F    Save file/Ex*/
  32.      "\12~\n",             /* HELP = ^J    Indent      */
  33.      "\30n~\n",            /* 0 = ^Xn      Next window */
  34.      "\13~\n",             /* 1 = ^K       Del to EOL  */
  35.      "2~\n",               /* 2 = 0                    */
  36.      "\33>~\n",            /* 3 = ESC >    End of buff */
  37.      "4~\n",               /* 4 = 0                    */
  38.      "5~\n",               /* 5 = 0                    */
  39.      "6~\n",               /* 6 = 0                    */
  40.      "7~\n",               /* 7 = 0                    */
  41.      "8~\n",               /* 8 = 0                    */
  42.      "\33<~\n",            /* 9 = ESC <    Top of buff */
  43.      "\30p~\n",            /* . = ^Xp      Prev window */
  44.      "\30\7~\n",           /* Enter = ^X^G Goto Line   */
  45.      "/*   */\2\2\2\2~\n"  /* -            Comm't mark */
  46.    };
  47.  
  48.    int i;
  49.    FILE *out_file, *fopen();
  50.  
  51.    out_file = fopen("emacs_config","w");
  52.  
  53.    /* Write func_key array to file */
  54.    for (i = 0; i < NUMKEYS + 1; ++i) 
  55.         fputs(func_key[i],out_file);
  56.  
  57.    fclose(out_file);
  58. }
  59.    
  60. /* -------------- End of Program ----------------*/
  61.